package com.dotc.patterndemo.structure.decorator;

import com.dotc.patterndemo.entity.Bag;

public class BagDecorator implements Bag {
    private Bag bag;//维持一个对抽象构件对象的引用

    //注入一个抽象构件类型的对象
    public  BagDecorator(Bag bag) {
        this.bag = bag;
    }

    @Override
    public void pack() {
        bag.pack();
    }
}
